﻿<UserControl x:Class="GeoFinderClientApp.View.UserControls.SearchingAreaSettingsControls"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:converters="clr-namespace:GeoFinderClientApp.Converters"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.Resources>
        <converters:BoolBrushConverter x:Key="BoolBrushConverter" />
        <converters:SearchingAreaTypeConverter x:Key="SearchingAreaTypeConverter"/>
        <converters:SearchingAreaDescriptionConverter x:Key="SearchingAreaDescriptionConverter" />
        <!--<vm:ViewModels x:Key="ViewModelsDataSource" d:IsDataSource="True"/>-->
        <Style x:Key="DescTextStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
            <Setter Property="FontSize" Value="18" />
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="Margin" Value="16,-38,16,24" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneChromeBrush}">
        <ListBox x:Name="SearchingAreaOptions" ItemsSource="{Binding}" SelectionChanged="TimeOutOptions_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="60"/>
                            <RowDefinition Height="130"/>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="280"/>
                                <ColumnDefinition Width="200"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock VerticalAlignment="Center" FontSize="22" HorizontalAlignment="Left"  Grid.Column="0" Text="{Binding Path=Type, Mode=OneWay, Converter={StaticResource SearchingAreaTypeConverter}}"/>
                            <TextBox VerticalAlignment="Top" Height="70" Width="200" HorizontalAlignment="Center" Grid.Column="1" InputScope="Number" x:Name="SearchingArea" Text="{Binding Path=SearchingArea, Mode=TwoWay}"/>
                        </Grid>
                        <Grid Grid.Row="1">
                            <TextBlock VerticalAlignment="Top" Margin="12,5" Style="{StaticResource DescTextStyle}"  Grid.Row="1" Text="{Binding Path=Type, Mode=OneWay, Converter={StaticResource SearchingAreaDescriptionConverter}}"/>
                        </Grid>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>